//
//  SRWorkListService.m
//  StoryShow
//
//  Created by CyonLeuMBP on 2017/6/7.
//  Copyright © 2017年 qudiandu.cn. All rights reserved.
//

#import "SRWorkListService.h"

#import "SRWorkListItemModel.h"
#import "SRWorkDetailModel.h"


@implementation SRWorkListService


/*
 *  查询作品列表
 */
+ (void)queryWorkListPage:(NSInteger)page uid:(NSString *)uid successBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"show_catalogue"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:@(page) forKey:@"start"];
    [params setValue:@(10) forKey:@"rows"];
    [params setValue:uid forKey:@"uid"];
    
    [manager GET:urlString needCache:NO parameters:params responseClass:[SRWorkListItemModel class] success:successBlock failure:failureBlock];
}

/*
 *  查询作品详情
 */
+ (void)queryWorkDetailWithWorkID:(NSString *)workID successBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"show_catalogueDetail"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:workID forKey:@"show_id"];
    
    [manager GET:urlString needCache:NO parameters:params responseClass:[SRWorkDetailModel class] success:successBlock failure:failureBlock];
}

/*
 *  删除作品
 */
+ (void)deleteWorkWithWorkID:(NSString *)workID successBlock:(FZSuccessBlock)successBlock failureBlock:(FZFailureBlock)failureBlock {
    NSString *urlString = [[SRAPICreater sharedInstance] APIWithName:@"show_catalogueDel"];
    SRNetWorkManager *manager = [SRNetWorkManager sharedInstance];
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:workID forKey:@"show_id"];
    
    [manager POST:urlString needCache:NO parameters:params responseClass:nil success:successBlock failure:failureBlock];
}


@end
